package com.dynamo.transport.network.practise.bio;

import java.net.Socket;

/**
 * @author duanyimiao
 * @create 2018-10-27 9:49 PM
 * @description
 **/
public class PrintHandler extends ChannelHandlerAdapter {

    @Override
    public void channelRead(byte[] bytes,Socket socket) {
        try {
            System.out.println("receive client msg="+new String(bytes));
            //向客户端回写消息
            socket.getOutputStream().write("tkx".getBytes());

        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
